package cn.rayYee.effects {
	import flash.events.Event;
	import flash.display.MovieClip;
	public class SimplePanel {
		public function SimplePanel() {
			
		}
		
		public static function ShowPanel(_mPanel:MovieClip) {
			_mPanel.removeEventListener(Event.ENTER_FRAME, onHideHandler);
			_mPanel.addEventListener(Event.ENTER_FRAME, onShowHandler);
		}
		public static function HidePanel(_mPanel:MovieClip) {
			_mPanel.removeEventListener(Event.ENTER_FRAME, onShowHandler);
			_mPaneladdEventListener(Event.ENTER_FRAME, onHideHandler);
		}
		
		
		private static function onHideHandler(e:Event):void {
			var tmpmc:MovieClip = e.currentTarget as MovieClip;
			if (tmpmc.currentFrame != 1) tmpmc.prevFrame();
			else removeEventListener(Event.ENTER_FRAME, onHideHandler);
		}
		private static function onShowHandler(e:Event):void {
			var tmpmc:MovieClip = e.currentTarget as MovieClip;
			if (tmpmc.currentFrame != tmpmc.totalFrames) tmpmc.nextFrame();
			else removeEventListener(Event.ENTER_FRAME, onShowHandler);
		}
	}
}